package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.DeviceDto;
import com.zzyl.dto.DevicePageQueryDto;
import com.zzyl.entity.Device;
import com.zzyl.entity.DeviceData;
import com.zzyl.vo.DeviceVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;
import java.util.List;

@Mapper
public interface DeviceMapper {

    @Select("select count(*) from device where device_name = #{deviceName}")
    int getByName(String deviceName);

    void insert(Device device);

    Page<DeviceVo> pageQueryDevice(DevicePageQueryDto devicePageQueryDto);

    DeviceVo getByIotId(String iotId);

    void updateDeviceById(Device deviceDto);

    void deleteByIotId(String iotId);

    void insertDeviceData(ArrayList<DeviceData> list);
}